using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace DeploymentExt
{
	/// <summary>
	/// Summary description for RestartWebServerForm.
	/// </summary>
	public class RestartWebServerForm : System.Windows.Forms.Form
	{
      private System.Windows.Forms.Label label1;
      private System.Windows.Forms.Label label2;
      private System.Windows.Forms.Button btnNo;
      private System.Windows.Forms.Button btnYes;

      private bool bResult = false;

		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;


      public bool Result
      {
         get { return bResult; }
      }

		public RestartWebServerForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
         this.label1 = new System.Windows.Forms.Label();
         this.label2 = new System.Windows.Forms.Label();
         this.btnNo = new System.Windows.Forms.Button();
         this.btnYes = new System.Windows.Forms.Button();
         this.SuspendLayout();
         // 
         // label1
         // 
         this.label1.Location = new System.Drawing.Point(24, 40);
         this.label1.Name = "label1";
         this.label1.Size = new System.Drawing.Size(200, 16);
         this.label1.TabIndex = 1;
         this.label1.Text = "Do you want to restart it now?";
         // 
         // label2
         // 
         this.label2.Location = new System.Drawing.Point(24, 16);
         this.label2.Name = "label2";
         this.label2.Size = new System.Drawing.Size(248, 16);
         this.label2.TabIndex = 0;
         this.label2.Text = "QuoteAdvantage requires IIS to be restarted. ";
         // 
         // btnNo
         // 
         this.btnNo.DialogResult = System.Windows.Forms.DialogResult.Cancel;
         this.btnNo.Location = new System.Drawing.Point(144, 80);
         this.btnNo.Name = "btnNo";
         this.btnNo.TabIndex = 3;
         this.btnNo.Text = "No";
         this.btnNo.Click += new System.EventHandler(this.btnNo_Click);
         // 
         // btnYes
         // 
         this.btnYes.Location = new System.Drawing.Point(56, 80);
         this.btnYes.Name = "btnYes";
         this.btnYes.TabIndex = 2;
         this.btnYes.Text = "Yes";
         this.btnYes.Click += new System.EventHandler(this.btnYes_Click);
         // 
         // RestartWebServerForm
         // 
         this.AcceptButton = this.btnYes;
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.CancelButton = this.btnNo;
         this.ClientSize = new System.Drawing.Size(272, 118);
         this.Controls.Add(this.btnYes);
         this.Controls.Add(this.btnNo);
         this.Controls.Add(this.label2);
         this.Controls.Add(this.label1);
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
         this.MaximizeBox = false;
         this.MinimizeBox = false;
         this.Name = "RestartWebServerForm";
         this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         this.Text = "QuoteAdvantage Installation";
         this.TopMost = true;
         this.Load += new System.EventHandler(this.RestartWebServerForm_Load);
         this.ResumeLayout(false);

      }
		#endregion

      private void btnYes_Click(object sender, System.EventArgs e)
      {
         bResult = true;
         this.Close();
      }

      private void btnNo_Click(object sender, System.EventArgs e)
      {
         this.Close();
      }

      private void RestartWebServerForm_Load(object sender, System.EventArgs e)
      {
         this.Show();
         this.BringToFront();
      }

	} // end class
}
